<template>
  <!-- <el-card> -->
  <ve-radar :data="radarData" :settings="radarSet"></ve-radar>
  <!-- </el-card> -->
</template>
<script>
// import.* as echarts from echarts/lib/echarts.js
import * as echarts from "echarts";

// import 'v-charts-v2/lib/line'
// import * as echarts from "echarts/lib/echarts.js";
export default {
  // props: {
  //   echartDataRaddar: {
  //     type: Array,
  //     default: () => [],
  //   },
  // },

  data() {
    // :colors="colors"
    // this.colors = ['#03C8D5', '#40A9F5'];
    //
    // this.chartSettings = {
    //     yAxisType: ['0.[00]a', '0.[00]%'],
    //     axisSite: {
    //         right: []
    //         // '下单率'
    //     },
    //     yAxisName: ['数值轴', '比率轴']
    // },

    return {
      dataMax: [
        { name: "firstPriceRangeNum", max: 600, min: 0 },
        { name: "secondPriceRangeNum", max: 600, min: 0 },
        { name: "thirdPriceRangeNum", max: 600, min: 0 },
        { name: "fourthPriceRangeNum", max: 600, min: 0 },
        { name: "fifthPriceRangeNum", max: 600, min: 0 },
        { name: "sixthPriceRangeNum", max: 600, min: 0 },
        { name: "seventhPriceRangeNum", max: 600, min: 0 },
        { name: "eighthPriceRangeNum", max: 600, min: 0 },
      ],
      //++++++++++++++++++  雷达图
      radarSet: {
        labelMap: {
          firstPriceRangeNum: "100以下",
          secondPriceRangeNum: "[100,150)",
          thirdPriceRangeNum: "[150,200)",
          fourthPriceRangeNum: "[200,250)",
          fifthPriceRangeNum: "[250,300)",
          sixthPriceRangeNum: "[300,350)",
          seventhPriceRangeNum: "[350,400)",
          eighthPriceRangeNum: "400以上",
        },
      },
      radarData: {
        columns: [
          "itemGrade",
          "firstPriceRangeNum",
          "secondPriceRangeNum",
          "thirdPriceRangeNum",
          "fourthPriceRangeNum",
          "fifthPriceRangeNum",
          "sixthPriceRangeNum",
          "seventhPriceRangeNum",
          "eighthPriceRangeNum",
        ],
        rows: [
          {
            createBy: null,
            createTime: "2023-12-29 14:19:39",
            updateBy: null,
            updateTime: null,
            remark: null,
            itemGrade: "运动下装",
            picUrl: null,
            salesAmount: 217319.17,
            returnAmount: 89710.29,
            netSalesAmount: 127608.88,
            totalSalesNumber: 999,
            netSalesNumber: 617,
            returnBeforeShipmentNumber: 113,
            returnAfterShipmentNumber: 269,
            totalReturnNumber: 382,
            comprehensiveReturnRate: 0.38,
            grossProfit: 92632.28,
            grossProfitRate: 0.73,
            endingInventory: 199261,
            exhaustionRate: 0.0,
            newTime: null,
            sdNumber: 24,
            mjxNumber: 0,
            payDateUnit: null,
            saleDays: 322,
            salesShare: null,
            returnBeforeShipmentRate: null,
            returnAfterShipmentRate: null,
            isNew: null,
            tendencyChart: null,
            firstPriceRangeNum: 17,
            firstPriceRangeNumRate: 0.01701701701701702,
            secondPriceRangeNum: 72,
            secondPriceRangeNumRate: 0.07207207207207207,
            thirdPriceRangeNum: 340,
            thirdPriceRangeNumRate: 0.34034034034034033,
            fourthPriceRangeNum: 360,
            fourthPriceRangeNumRate: 0.36036036036036034,
            fifthPriceRangeNum: 190,
            fifthPriceRangeNumRate: 0.19019019019019018,
            sixthPriceRangeNum: 6,
            sixthPriceRangeNumRate: 0.006006006006006006,
            seventhPriceRangeNum: 14,
            seventhPriceRangeNumRate: 0.014014014014014014,
            eighthPriceRangeNum: 0,
            eighthPriceRangeNumRate: 0.0,
            picFullUrl: null,
          },
          {
            createBy: null,
            createTime: "2023-12-29 14:19:39",
            updateBy: null,
            updateTime: null,
            remark: null,
            itemGrade: "运动上衣",
            picUrl: null,
            salesAmount: 199471.35,
            returnAmount: 84082.12,
            netSalesAmount: 115389.23,
            totalSalesNumber: 873,
            netSalesNumber: 536,
            returnBeforeShipmentNumber: 101,
            returnAfterShipmentNumber: 236,
            totalReturnNumber: 337,
            comprehensiveReturnRate: 0.39,
            grossProfit: 82316.87,
            grossProfitRate: 0.71,
            endingInventory: 128202,
            exhaustionRate: 0.0,
            newTime: null,
            sdNumber: 24,
            mjxNumber: 0,
            payDateUnit: null,
            saleDays: 239,
            salesShare: null,
            returnBeforeShipmentRate: null,
            returnAfterShipmentRate: null,
            isNew: null,
            tendencyChart: null,
            firstPriceRangeNum: 48,
            firstPriceRangeNumRate: 0.054982817869415807,
            secondPriceRangeNum: 46,
            secondPriceRangeNumRate: 0.052691867124856816,
            thirdPriceRangeNum: 377,
            thirdPriceRangeNumRate: 0.43184421534937,
            fourthPriceRangeNum: 109,
            fourthPriceRangeNumRate: 0.12485681557846506,
            fifthPriceRangeNum: 163,
            fifthPriceRangeNumRate: 0.18671248568155785,
            sixthPriceRangeNum: 6,
            sixthPriceRangeNumRate: 0.006872852233676976,
            seventhPriceRangeNum: 121,
            seventhPriceRangeNumRate: 0.13860252004581902,
            eighthPriceRangeNum: 3,
            eighthPriceRangeNumRate: 0.003436426116838488,
            picFullUrl: null,
          },
          {
            createBy: null,
            createTime: "2023-12-29 14:19:39",
            updateBy: null,
            updateTime: null,
            remark: null,
            itemGrade: "运动文胸",
            picUrl: null,
            salesAmount: 127161.85,
            returnAmount: 56015.63,
            netSalesAmount: 71146.22,
            totalSalesNumber: 571,
            netSalesNumber: 338,
            returnBeforeShipmentNumber: 63,
            returnAfterShipmentNumber: 170,
            totalReturnNumber: 233,
            comprehensiveReturnRate: 0.41,
            grossProfit: 50516.73,
            grossProfitRate: 0.71,
            endingInventory: 234286,
            exhaustionRate: 0.0,
            newTime: null,
            sdNumber: 33,
            mjxNumber: 0,
            payDateUnit: null,
            saleDays: 693,
            salesShare: null,
            returnBeforeShipmentRate: null,
            returnAfterShipmentRate: null,
            isNew: null,
            tendencyChart: null,
            firstPriceRangeNum: 3,
            firstPriceRangeNumRate: 0.005253940455341506,
            secondPriceRangeNum: 72,
            secondPriceRangeNumRate: 0.12609457092819615,
            thirdPriceRangeNum: 213,
            thirdPriceRangeNumRate: 0.37302977232924694,
            fourthPriceRangeNum: 99,
            fourthPriceRangeNumRate: 0.1733800350262697,
            fifthPriceRangeNum: 165,
            fifthPriceRangeNumRate: 0.28896672504378285,
            sixthPriceRangeNum: 1,
            sixthPriceRangeNumRate: 0.0017513134851138354,
            seventhPriceRangeNum: 18,
            seventhPriceRangeNumRate: 0.03152364273204904,
            eighthPriceRangeNum: 0,
            eighthPriceRangeNumRate: 0.0,
            picFullUrl: null,
          },
          {
            createBy: null,
            createTime: "2023-12-29 14:19:39",
            updateBy: null,
            updateTime: null,
            remark: null,
            itemGrade: "配件",
            picUrl: null,
            salesAmount: 4975.74,
            returnAmount: 581.43,
            netSalesAmount: 4394.31,
            totalSalesNumber: 321,
            netSalesNumber: 311,
            returnBeforeShipmentNumber: 7,
            returnAfterShipmentNumber: 3,
            totalReturnNumber: 10,
            comprehensiveReturnRate: 0.03,
            grossProfit: 2136.72,
            grossProfitRate: 0.49,
            endingInventory: 44231,
            exhaustionRate: 0.01,
            newTime: null,
            sdNumber: 0,
            mjxNumber: 0,
            payDateUnit: null,
            saleDays: 142,
            salesShare: null,
            returnBeforeShipmentRate: null,
            returnAfterShipmentRate: null,
            isNew: null,
            tendencyChart: null,
            firstPriceRangeNum: 319,
            firstPriceRangeNumRate: 0.9937694704049844,
            secondPriceRangeNum: 2,
            secondPriceRangeNumRate: 0.006230529595015576,
            thirdPriceRangeNum: 0,
            thirdPriceRangeNumRate: 0.0,
            fourthPriceRangeNum: 0,
            fourthPriceRangeNumRate: 0.0,
            fifthPriceRangeNum: 0,
            fifthPriceRangeNumRate: 0.0,
            sixthPriceRangeNum: 0,
            sixthPriceRangeNumRate: 0.0,
            seventhPriceRangeNum: 0,
            seventhPriceRangeNumRate: 0.0,
            eighthPriceRangeNum: 0,
            eighthPriceRangeNumRate: 0.0,
            picFullUrl: null,
          },
        ],
      },
    };
  },
  // computed: {
  //     axisOption() {
  //         return this.chartData
  //     }
  // },
  watch: {
    // echartDataRaddar: {
    //   handler: function (newnew, oldold) {
    //     // console.log(JSON.stringify(newnew));
    //     // newnew.columns.forEach((item) => {
    //     //   if (item.includes("率")) {
    //     //     this.chartSettings.axisSite.right.push(item);
    //     //     if (item.includes("连带率")) {
    //     //       this.chartSettings.axisSite.right = [];
    //     //       this.axisOption = newnew;
    //     //       // this.axisOption.columns = this.chartData.columns
    //     //     }
    //     //   } else {
    //     //     this.chartSettings.axisSite.right = [];
    //     //     this.axisOption = newnew;
    //     //     // this.axisOption.columns = this.chartData.columns
    //     //   }
    //     // });
    //     // this.axisOption.rows = this.chartData.rows
    //     // this.initChart()
    //     // this.axisOption = newnew;
    //     // 这里需要让表格重新绘制一下，否则会产生固定列错位的情况
    //     console.log(JSON.stringify(newnew));
    //     this.radarData.rows = newnew;
    //     this.$nextTick(() => {
    //       // this.$refs.table.doLayout();
    //       this.$refs.table.echarts.resize();
    //       // console.log('渲染完成时间', new Date());
    //     });
    //   },
    //   deep: true,
    //   immediate: true,
    // },
  },

  methods: {
    // initChart() {
    //   this.axisOption = this.echartDataSku;
    // },
  },
};
</script>
